package router

import (
	"SE/controller"
	"SE/global"
	"SE/repository"
	"SE/service"
	"github.com/gin-gonic/gin"
)

func UserRouter(Router *gin.RouterGroup) {
	user := Router.Group("/user")
	{
		//middlewares.JWTAuth(),
		user.GET("/login", controller.Login)

		userRepo := repository.NewUserRepository(global.DB)
		userService := service.NewUserService(userRepo)
		userController := controller.NewUserController(userService)

		user.POST("/register", userController.Register)

		user.GET("/captcha", controller.GetCaptcha)

		user.GET("/mLogin", controller.MLogin)

		user.GET("/history", controller.SearchHistory)

		user.GET("/mPhone", controller.MPhone)
	}

}
